
<?php
//$set_txtContactName = (set_value('txtContactName') == '')?$hoteldetails['txtContactName']:set_value('txtContactName');
?>
<div class="form_content">
    <header><h3>Set Featured event</h3></header>
    <div class="module_content">
        <?php if($image_deleted):?>
        <div class="error"><?php echo $image_deleted; ?></div>
        <?php endif;?>
        <?php //echo validation_errors(); ?>
        <form name="eventform" id="eventform"  action="<?php echo base_url(); ?>secu/events/updatefeaturedevent" method="post" onsubmit="return validateForm()" >
        <input type="hidden" name="id" id="id" value="<?php echo $id; ?>">
        <fieldset>
            <label>Select Event</label>
            <select onchange="" name="eventid" id="eventid" style="width: 220px;">
                <option value="">Select Event</option>
                <?php foreach ($eventlist as $val) :?>
                    <option value="<?php echo $val['id']; ?>" <?php echo ($feturedevent['id']==$val['id']?"selected=selected":"") ?>><?php echo $val['eventtile']; ?></option>
                <?php endforeach; ?>
            </select>
        </fieldset>
       
        <fieldset>
            <input type="submit" name="submit" id="submit" value="SAVE"  >&nbsp;
        </fieldset>

        <div class="clear"></div>
        </form>

        <div class="clear"></div>
     <?php if(1==2):?>
        <form enctype="multipart/form-data" id="fupload" method="post" action="<?php echo base_url(); ?>secu/events/savefeaturedeventimages/">
            <input type="hidden" name="id" value="<?php echo $feturedevent['id'];?>" id="id">
            <input type="hidden" name="upload_from" value="eventimg" id="upload_from">
            <a name="img"></a>
            <fieldset style="width:50%; float:left; padding: 10px 0 10px 10px;">
            <input name="userfile" type="file" size="40"/>
            <input type="submit" name="btn_upload" value="Upload &uarr;" class="btnupload"/>
            </fieldset>
            <?php if (isset ($imgerror)) { ?>
            <div class="error"><?php echo $imgerror; ?></div>
            <?php } ?>

        </form>
        <div class="clear"></div>
        <fieldset style="padding: 10px; width:200px">
        <?php if($feturedevent['image']) { ?>

                    <div class="imgbox">
                        <a class=""  href="<?php echo base_url(); ?>images/events/original/<?php echo $feturedevent['image'] ?>">
                        <img class="thumb" name="thumb" id="" src="<?php echo base_url(); ?>images/events/thumb/thumb_<?php echo $feturedevent['image'] ?>"/>
                        </a>
                        <div>
                          <!--  <a class="adel" href="<?php echo base_url()?>secu/event/deleteeventimage/name/<?php echo $feturedevent['image']; ?>/id/<?php echo $feturedevent["id"] ;?>">
                            <img src="<?php echo base_url(); ?>images/admin/icn_trash.png" title="Trash">delete
                            </a>-->
                        </div>
                    </div>

                <?php } ?>
            </fieldset>
                <div class="clear"></div>
       <?php endif;?>
    </div>



</div>
<script>
$(function() {
        $( "#event_start" ).datetimepicker()({dateFormat: "yy-mm-dd"});
        $( "#event_end" ).datetimepicker()({dateFormat: "yy-mm-dd"});
});
</script>
<script type="text/javascript">

 function validateForm()
 {
     <?php foreach($partnerlang as $langkey=>$langval){?>
     var hotelname<?php echo $langval?>=document.forms["eventform"]["title<?php echo $langval?>"].value;
     var hotelname<?php echo $langval?>=document.forms["eventform"]["desc<?php echo $langval?>"].value;
     <?php } ?>
     var numBeds=document.forms["eventform"]["numBeds"].value;
     var numStars=document.forms["eventform"]["numStars"].value;
     var accchecked=document.getElementsByName('accomodation[]');
     var txtPhoneNo=document.forms["eventform"]["txtPhoneNo"].value;
     var txtFaxNo=document.forms["eventform"]["txtFaxNo"].value;
     var txtWebAddress=document.forms["eventform"]["txtWebAddress"].value;
     var txtEmailAddress=document.forms["eventform"]["txtEmailAddress"].value;
     var txtContactName=document.forms["eventform"]["txtContactName"].value;

     if (!hascheckboxes(accchecked))
      {
          alert("Please Select a Accommodation Type");
          accchecked[0].focus();
          return false;
      }
      <?php foreach($partnerlang as $langkey=>$langval){?>
    if (title+<?php echo $langval?>==null || title+<?php echo $langval?>=="")
      {
          alert("Please Enter the Title-<?php echo $langval?>");
          document.getElementById("title<?php echo $langval?>").focus();
          return false;
      }
    if(desc+<?php echo $langval?>==null || desc+<?php echo $langval?>=="")
         {
          alert("Please Enter the Description-<?php echo $langval?>");
          document.getElementById("desc<?php echo $langval?>").focus();
          return false;
      }
      <?php } ?>
     if(numBeds==null || numBeds=="" || !isNumber(numBeds))
         {
          alert(" Please enter a valid hotel room #");
          document.getElementById("numBeds").focus();
          return false;
      }
       if(numStars==null || numStars=="" || !isNumber(numStars))
         {
          alert(" Please select a star status");
          document.getElementById("numStars").focus();
          return false;
      }
       if(numBeds==null || numBeds=="" || !isEmail(txtEmailAddress))
      {
               alert("Please enter a valid Email");
          document.getElementById("txtEmailAddress").focus();
          return false;
      }
      if(txtContactName==null || txtContactName=="")
      {
          alert(" Please enter a valid Contact name");
          document.getElementById("txtContactName").focus();
          return false;
      }

      if((txtPhoneNo!=""))
      {
             if(!isNumber(txtPhoneNo) || txtPhoneNo.length>11){
                  alert("Please enter a valid phone no");
                  document.getElementById("txtPhoneNo").focus();
                  return false;
             }

      }
      if ((txtFaxNo!=""))
       {
          if(!isNumber(txtFaxNo) || txtFaxNo.length>11){
              alert("Please enter a valid fax no");
              document.getElementById("txtFaxNo").focus();
              return false;
          }
        }

       if((txtWebAddress!="" ))
      {
          if(!isURL(txtWebAddress))
              {
                      alert("Please enter a valid Web Address");
                      document.getElementById("txtWebAddress").focus();
                      return false;
              }

      }


 }


</script>



